import request from '@/axios'
import type { TableData } from './types'

export const getTableListApi = (data: Partial<TableData>): Promise<IResponse> => {
  return request.post({ url: '/api/v1/baopr/page.do', data })
}
export const saveTableApi = (data: Partial<TableData>): Promise<IResponse> => {
  return request.post({ url: '/api/v1/baopr/save.do', data })
}

export const getTableDetApi = (id: string): Promise<IResponse<TableData>> => {
  return request.get({ url: '/api/v1/baopr/detail', params: { id } })
}
export const delTableListApi = (ids: string[] | number[]): Promise<IResponse> => {
  return request.post({ url: '/api/v1/baopr/del.do', data: { ids } })
}
export const getGroupTableListApi = (ids: string[] | number[]): Promise<IResponse> => {
  return request.post({ url: '/api/v1/bagrp/getname.do', data: { ids } })
}
export const getOperatorTableListApi = (ids: string[] | number[]): Promise<IResponse> => {
  return request.post({ url: '/api/v1/baopr/getname.do', data: { ids } })
}

export const getBacthUpdateTableListApi = (data: Partial<TableData>): Promise<IResponse> => {
  return request.post({ url: '/api/v1/prj/bnbacc.do', data })
}
